//package com.loopy.fruns.web;
//
//import com.loopy.fruns.dao.impl.MemberDAOImpl;
//import com.loopy.fruns.entity.Member;
//import com.loopy.fruns.service.MemberService;
//import com.loopy.fruns.service.impl.MemberServiceImpl;
//
//import javax.servlet.*;
//import javax.servlet.http.*;
//import java.io.IOException;
//
//public class LoginServlet extends HttpServlet {
//    private MemberService memberService=new MemberServiceImpl();
//    @Override
//    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        doPost(request, response);
//    }
//
//    @Override
//    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        System.out.println("LoginServlet被调用");
//        String userName = request.getParameter("user-name");
//        String userPassword = request.getParameter("user-password");
//        Member login = memberService.login(new Member(null,userName,userPassword,null));
//        if(login==null){
//            request.setAttribute("username",userName);
//            request.setAttribute("msg","用户名或密码错误");
//            request.getRequestDispatcher("/views/member/login.jsp").forward(request,response);
//        }else {
//            request.getRequestDispatcher("/views/member/login_ok.jsp").forward(request,response);
//        }
//    }
//}
